package com.lagou.niancheng.core.session.defaults;

import com.lagou.niancheng.core.config.Configuration;
import com.lagou.niancheng.core.result.ResultSetConverter;
import com.lagou.niancheng.core.session.Executor;
import com.lagou.niancheng.core.session.ExecutorFactory;
import com.lagou.niancheng.core.transaction.TransactionManager;

/**
 * com.lagou.niancheng.core.session.defaults.DefaultExecutorFactory
 *
 * @author 大犬
 * @date 2020/3/27
 */
public class DefaultExecutorFactory implements ExecutorFactory {

    @Override
    public Executor createExecutor(Configuration configuration) {
        ResultSetConverter resultSetConverter = configuration.getResultSetConverter();
        TransactionManager transactionManager = configuration.getTransactionManager();
        return new DefaultExecutor(resultSetConverter, transactionManager);
    }
}
